﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace TestForm
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            String path, code;
            path = Application.ExecutablePath.Replace(@"\", @"\\");
            code = "Windows Registry Editor Version 5.00" + Environment.NewLine + Environment.NewLine;
            code += "[HKEY_CLASSES_ROOT\\Directory\\shell\\View with MangaReader\\command]" + Environment.NewLine;
            code += "@=\"" + path + " %1\"";
            System.IO.File.WriteAllText("addContext.reg", code);
            System.Diagnostics.Process.Start("addContext.reg");
        }

        private void button2_Click(object sender, EventArgs e)
        {
            String path, code;
            path = Application.ExecutablePath.Replace(@"\", @"\\");
            code = "Windows Registry Editor Version 5.00" + Environment.NewLine + Environment.NewLine;
            code += "[-HKEY_CLASSES_ROOT\\Directory\\shell\\View with MangaReader]" + Environment.NewLine;
            System.IO.File.WriteAllText("removeContext.reg", code);
            System.Diagnostics.Process.Start("removeContext.reg");
        }
    }
}
